package controller;

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;

import model.GroupManager;
import model.Project;

import java.util.List;

@WebServlet("/GroupServlet")
public class GroupServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        GroupManager groupManager = (GroupManager) getServletContext().getAttribute("groupManager");
        List<Project> projectList = (List<Project>) getServletContext().getAttribute("projectList");

        request.setAttribute("groups", groupManager.getGroups());
        request.setAttribute("projectList", projectList);

        request.getRequestDispatcher("groupResult.jsp").forward(request, response);
    }
}
